Skip to content

doc: Add SQL examples for SEMI + ANTI Joins #16316

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Jun 12, 2025

Conversation

jonathanc-n
Copy link
Contributor

Which issue does this PR close?

Rationale for this change

We are currently missing documentation on Left Mark Join, Right Mark Join, Left Semi Join and Right Semi Join. We should add an explanation for how they work + sql examples.

What changes are included in this PR?

Added sql examples + explanation for Left Mark Join, Right Mark Join, Left Semi Join and Right Semi Join. Also did some drive by clean up to make the sql examples a little nicer 😄

Are these changes tested?

No, just doc changes

Are there any user-facing changes?

Yes, documentation for the different join clauses

@github-actions github-actions bot added the documentation Improvements or additions to documentation label Jun 7, 2025
@xudong963 xudong963 requested a review from Copilot June 9, 2025 10:06
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR enhances the SQL documentation by introducing examples and explanations for semi and anti join variants.

  • Expanded the JOIN clause overview to include LEFT SEMI, RIGHT SEMI, LEFT ANTI, and RIGHT ANTI joins.
  • Added descriptive text and SQL examples for each new join type.
  • Performed minor formatting cleanup on existing SQL snippets.
Comments suppressed due to low confidence (1)

docs/source/user-guide/sql/select.md:202

  • [nitpick] For parallel structure with the LEFT SEMI JOIN description, consider rephrasing to 'projects only the columns from the right table.'
only projects the columns from the right table.

right side of the join.

```sql
select * from x cross join x y;
SELECT * from x CROSS JOIN x y;
Copy link
Preview

Copilot AI Jun 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Use consistent uppercase SQL keywords; change 'from' to 'FROM' to match other examples.

Suggested change
SELECT * from x CROSS JOIN x y;
SELECT * FROM x CROSS JOIN x y;

Copilot uses AI. Check for mistakes.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jonathanc-n I think it makes sense haha

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oops missed that one

Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @jonathanc-n -- this looks like a nice change to me

@alamb alamb merged commit 3a371ed into apache:main Jun 12, 2025
5 checks passed
@jonathanc-n jonathanc-n deleted the update-join-doc branch June 16, 2025 23:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Document semi join, anti semi join and more supported join types
5 participants